Skip to content

Add historical binary log replay coverage - #14782

Open
kawmy wants to merge 2 commits into
dotnet:mainfrom
kawmy:6587-historical-binlog-playback-tests
Open

Add historical binary log replay coverage#14782
kawmy wants to merge 2 commits into
dotnet:mainfrom
kawmy:6587-historical-binlog-playback-tests

Conversation

@kawmy

@kawmy kawmy commented Aug 21, 2026

Copy link
Copy Markdown

Fixes #6587

Context

MSBuild does not currently have focused regression coverage proving that the current BinaryLogReplayEventSource can replay historical binary-log file formats 1 through 14. Without checked-in compatibility fixtures, a reader change could break older .binlog files without being detected by the test suite.

Changes Made

  • Added a small canonical MSBuild project used to produce compatibility fixtures.
  • Added compact binary-log fixtures for historical file-format versions 1 through 14.
  • Added CanReplayHistoricalBinaryLogFormats, which replays each fixture and verifies:
    • the reported file-format version;
    • that events were produced;
    • one project and two targets were replayed; and
    • the recorded build completed successfully.

All new test assertions use Shouldly, as recommended by the contribution guide.

Testing

  • Built and ran an isolated validator using the repository-pinned .NET SDK's MSBuild reader (18.10.0-1.26360.111). All 14 fixtures replayed successfully with the expected format version, one project, two targets, and successful completion.
  • Built Canonical.proj successfully with zero warnings and zero errors.
  • Verified every fixture has a gzip header and a stable SHA-256 digest.
  • Verified git diff --check passes.

The full Microsoft.Build.Engine.UnitTests project was not restored locally because the isolated environment does not contain its full dependency graph. No bulk package restore was performed; CI should provide the complete project-level validation.

Notes

  • This is a test-only change and does not modify product behavior or the current binary-log format.
  • Every fixture records a build of the checked-in Canonical.proj and uses the historical serializer format identified by its filename.
  • For the oldest formats whose original toolchains no longer run directly on the current machine, the corresponding historical serializer source was hosted in a compatible generator. No profiler events are present in the fixtures.

@kawmy
kawmy deployed to copilot-pat-pool August 21, 2026 23:05 — with GitHub Actions Active
@kawmy
kawmy deployed to copilot-pat-pool August 21, 2026 23:05 — with GitHub Actions Active
@kawmy

kawmy commented Aug 21, 2026

Copy link
Copy Markdown
Author

@dotnet-policy-service agree

@kawmy

kawmy commented Aug 22, 2026

Copy link
Copy Markdown
Author

Could a maintainer please rerun the failed Windows checks?
I reviewed the logs for commit 8a5e59a. The changed Microsoft.Build.Engine.UnitTests assembly passed on both net472|x86 and net11.0|x64, including in the failed Windows jobs. The failures came only from the unchanged Microsoft.Build.BuildCheck.UnitTests assembly in the Debug configuration. The same BuildCheck assemblies passed in the Windows Release job.
This appears unrelated to the historical binlog changes in this PR. Thank you!

@ViktorHofer ViktorHofer self-assigned this Aug 25, 2026
@ViktorHofer

Copy link
Copy Markdown
Member

@kawmy thanks for the submission. How did you generate the binlogs? We will need to do that activity again whenever we would introduce a new format. So a target to invoke on the test project or so would be great.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add tests for playing back binlogs of each file format

2 participants